<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-player-edit" th:object="${player}">
            <input id="playerId" name="playerId" th:field="*{playerId}"  type="hidden">
			<div class="form-group">
				<label class="col-sm-3 control-label">难度等级：</label>
				<div class="col-sm-8">
					<select name="difficultLevel" class="form-control m-b" th:with="type=${@dict.getType('jl_difficult_level')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{difficultLevel}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">水果类型：</label>
				<div class="col-sm-8">
					<select name="slotType" class="form-control m-b" th:with="type=${@dict.getType('jl_slot_type')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{slotType}"></option>
					</select>
				</div>
			</div>
			<!--<div class="form-group">
				<label class="col-sm-3 control-label">VIP等级：</label>
				<div class="col-sm-8">
					<input id="vipLevel" name="vipLevel" th:field="*{vipLevel}" class="form-control" type="text">
				</div>
			</div>-->
			<input name="vipLevel"  type="hidden"  th:field="*{vipLevel}" id="treeId"/>
			<div class="form-group">
				<label class="col-sm-3 control-label">VIP等级：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="vipLevel" onclick="selectDeptTree()" readonly="true" id="treeName" th:field="*{vipName}">
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "jl/player";
		$("#form-player-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-player-edit').serialize());
	        }
	    }

		/*用户管理-修改-选择部门树*/
        function selectDeptTree() {
            var deptId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val();
            var url = ctx + "jl/vip/selectVipTree/" + deptId;
            var options = {
                title: '选择VIP',
                width: "380",
                url: url,
                callBack: doSubmit
            };
            $.modal.openOptions(options);
        }

        function doSubmit(index, layero){
            var tree = layero.find("iframe")[0].contentWindow.$._tree;
            if ($.tree.notAllowParents(tree)) {
                var body = layer.getChildFrame('body', index);
                $("#treeId").val(body.find('#treeId').val());
                $("#treeName").val(body.find('#treeName').val());
                layer.close(index);
            }
        }
	</script>
</body>
</html>
